<template>
  <div>
    <div class="titleh1">平台数据总览</div>
    <div id="main"></div>
  </div>
</template>

<script>
export default {
  mounted() {
    this.initEcharts();
  },
  methods: {
    initEcharts() {
      var chartDom = document.getElementById("main");
      var myChart = this.$echarts.init(chartDom);
      var option;

      option = {
        xAxis: {
          type: "category",
          data: ["普通用户", "志愿者", "贫困户", "留言量", "点击量", "政策"],
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            data: [35550, 13000, 42000, 5481, 55410, 9999],
            type: "bar",
            showBackground: true,
            backgroundStyle: {
              color: "rgba(180, 180, 180, 0.2)",
            },
          },
        ],
      };

      option && myChart.setOption(option);
    },
  },
};
</script>

<style lang="less" scoped>
#main {
  width: 700px;
  height: 450px;
  margin: 0px auto ;
}
.titleh1{
  margin-top: 100px;
  text-align: center;
  font-size: 30px;
  font-weight: 700;
}
</style>